package com.gsn.poker.play;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.gsn.desktop.engine.ActorUtility;
import com.gsn.desktop.engine.GdxUtility;
import com.gsn.engine.myplay.GsnGame;
import com.gsn.engine.template.GsnLabel;
import com.gsn.poker.asset.PokerTexture;

public class BetInfoGroup extends Group {
	
	public Label label;
	public long bet;
	public BetInfoGroup(int bet) {
		transform = false;
		Image bg = new Image(PokerTexture.inst().bgBet);
		Image icon = new Image(PokerTexture.inst().iconUSDcuoc);
		ActorUtility.setRatio(icon, -0.1f, 0.5f, 0.5f, bg.height * 0.5f);
		this.bet = bet;
		label = new Label(GdxUtility.formatNumber(bet), new Label.LabelStyle(PokerTexture.inst().fontLarge, new Color(1, 1, 0, 1)));
		
		ActorUtility.setRatio(label, 0, 0.4f, icon.x + icon.width * 1.3f, bg.height * 0.5f);
		
		addActor(bg);
		addActor(icon);
		addActor(label);
		
		this.height = icon.height;
		this.width = bg.width;
	}	
	public void updateMoney(long bet)
	{
		this.bet = bet;
		label.setText(GdxUtility.formatNumber(bet));
	}
}
